package br.com.opengti.webforum.ws.domain.impl;

import java.util.Calendar;
import java.util.List;

import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.persistence.Transient;

import br.com.opengti.webforum.ws.infra.dao.WebForumDomainSupport;

/**
 * @author Felipe Balbino <felipe@opengti.com.br>
 * @author Gabriel Cardelli <cardelli@opengti.com.br>
 */
@Entity
public class Resposta {
	
	@Transient private WebForumDomainSupport webForumDomainSupport;
	
	@Id
	@GeneratedValue
	private Integer id;
	
	@ManyToOne
	private Usuario usuario;
	
	private String resposta;
	
	@Temporal(TemporalType.TIMESTAMP)
	private Calendar dataReposta;
	
	@ManyToOne
	@JoinColumn(name="topico_id")
	private Topico topico;
	
	@OneToMany(mappedBy="resposta")
	private List<Vote> votes;

}
